package com.ncmmall.domain.business.order.aftersale;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.ncmmall.domain.security.user.WebUser;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * @author linxs
 * @Description: 售后图片
 * @Date: 2019-07-23 12:13
 */
@Entity
@Table(name = "mall_order_after_sale_image")
@Access(AccessType.FIELD)
public class OrderAfterSaleImage {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long id;

    /**
     * 所属商品
     */
    @JsonBackReference
    @ManyToOne
    @JoinColumn(name = "orderAfterSaleId")
    @NotFound(action = NotFoundAction.IGNORE)
    private OrderAfterSale orderAfterSale;

    /**
     * 所属商家
     */
    @JsonBackReference
    @OneToOne
    private WebUser merchant;

    /**
     * 会员
     */
    @JsonBackReference
    @OneToOne
    private WebUser member;

    /**
     * 图片名称
     */
    private String name;

    /**
     * 上传时间
     */
    private Timestamp createTime;


    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public OrderAfterSale getOrderAfterSale() {
        return orderAfterSale;
    }

    public void setOrderAfterSale(OrderAfterSale orderAfterSale) {
        this.orderAfterSale = orderAfterSale;
    }

    public WebUser getMerchant() {
        return merchant;
    }

    public void setMerchant(WebUser merchant) {
        this.merchant = merchant;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    public WebUser getMember() {
        return member;
    }

    public void setMember(WebUser member) {
        this.member = member;
    }
}
